package com.ymttest.database.mapping.wxcomponent;

import com.ymttest.database.mapping.wxcomponent.PlatformconfigSqlProvider;
import com.ymttest.database.model.Auditrecord;
import com.ymttest.database.model.AuditrecordExample;
import com.ymttest.database.model.Mchapp;
import com.ymttest.database.model.MchappExample;
import com.ymttest.database.model.Mchchargerecord;
import com.ymttest.database.model.MchchargerecordExample;
import com.ymttest.database.model.Platformconfig;
import com.ymttest.database.model.PlatformconfigExample;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface WxMchAutoMapper {
	@SelectProvider(type=MchchargerecordSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="MchChargeRecordId", property="mchChargeRecordId", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="MchId", property="mchId", jdbcType=JdbcType.INTEGER),
        @Result(column="Money", property="money", jdbcType=JdbcType.DECIMAL),
        @Result(column="chargeStatus", property="chargeStatus", jdbcType=JdbcType.INTEGER),
        @Result(column="TradeNo", property="tradeNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="Msg", property="msg", jdbcType=JdbcType.VARCHAR),
        @Result(column="ChargeTime", property="chargeTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="CreateTime", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="UpdateTime", property="updateTime", jdbcType=JdbcType.TIMESTAMP)
    })
    List<Mchchargerecord> selectMchChargeRecordIdByExample(MchchargerecordExample example);
	
    @SelectProvider(type=AuditrecordSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="AuditRecordId", property="auditRecordId", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="AppId", property="appId", jdbcType=JdbcType.VARCHAR),
        @Result(column="MchId", property="mchId", jdbcType=JdbcType.INTEGER),
        @Result(column="AuditStatus", property="auditStatus", jdbcType=JdbcType.INTEGER),
        @Result(column="DelayTime", property="delayTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="SuccessTime", property="successTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="AuditId", property="auditId", jdbcType=JdbcType.VARCHAR),
        @Result(column="AuditCode", property="auditCode", jdbcType=JdbcType.INTEGER),
        @Result(column="Reason", property="reason", jdbcType=JdbcType.VARCHAR),
        @Result(column="ScreenShot", property="screenShot", jdbcType=JdbcType.VARCHAR),
        @Result(column="CreateTime", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="UpdateTime", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="TemplateId", property="templateId", jdbcType=JdbcType.VARCHAR),
        @Result(column="version", property="version", jdbcType=JdbcType.VARCHAR)
    })
    List<Auditrecord> selectAuditrecordByExample(AuditrecordExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table auditrecord
     *
     * @mbggenerated Fri Dec 13 15:15:51 CST 2019
     */
    @UpdateProvider(type=AuditrecordSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateAuditrecordByPrimaryKeySelective(Auditrecord record);
	/**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table platformconfig
     *
     * @mbggenerated Fri Dec 13 14:58:31 CST 2019
     */
    @SelectProvider(type=PlatformconfigSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="PlatformAppId", property="platformAppId", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="AppSecret", property="appSecret", jdbcType=JdbcType.VARCHAR),
        @Result(column="VerifyTicket", property="verifyTicket", jdbcType=JdbcType.VARCHAR),
        @Result(column="AccessToken", property="accessToken", jdbcType=JdbcType.VARCHAR),
        @Result(column="CreateTime", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="UpdateTime", property="updateTime", jdbcType=JdbcType.TIMESTAMP)
    })
    List<Platformconfig> selectPlatformconfigByExample(PlatformconfigExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table platformconfig
     *
     * @mbggenerated Fri Dec 13 14:58:31 CST 2019
     */
    @UpdateProvider(type=PlatformconfigSqlProvider.class, method="updateByPrimaryKeySelective")
    int updatePlatformconfigByPrimaryKeySelective(Platformconfig record);


    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mchapp
     *
     * @mbggenerated Fri Dec 13 10:50:40 CST 2019
     */
    @InsertProvider(type=MchappSqlProvider.class, method="insertSelective")
    int insertMchappSelective(Mchapp record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mchapp
     *
     * @mbggenerated Fri Dec 13 10:50:40 CST 2019
     */
    @SelectProvider(type=MchappSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="AppId", property="appId", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="MchId", property="mchId", jdbcType=JdbcType.INTEGER),
        @Result(column="AppStatus", property="appStatus", jdbcType=JdbcType.INTEGER),
        @Result(column="IsPublished", property="isPublished", jdbcType=JdbcType.BIT),
        @Result(column="PayChannelStatus", property="payChannelStatus", jdbcType=JdbcType.INTEGER),
        @Result(column="RefreshToken", property="refreshToken", jdbcType=JdbcType.VARCHAR),
        @Result(column="AccessToken", property="accessToken", jdbcType=JdbcType.VARCHAR),
        @Result(column="AppName", property="appName", jdbcType=JdbcType.VARCHAR),
        @Result(column="AppNameStatus", property="appNameStatus", jdbcType=JdbcType.INTEGER),
        @Result(column="PrincipalName", property="principalName", jdbcType=JdbcType.VARCHAR),
        @Result(column="PrincipalType", property="principalType", jdbcType=JdbcType.INTEGER),
        @Result(column="RealNameStatus", property="realNameStatus", jdbcType=JdbcType.INTEGER),
        @Result(column="HeadImgUrl", property="headImgUrl", jdbcType=JdbcType.VARCHAR),
        @Result(column="Categories", property="categories", jdbcType=JdbcType.VARCHAR),
        @Result(column="Remark", property="remark", jdbcType=JdbcType.VARCHAR),
        @Result(column="AuditRecordId", property="auditRecordId", jdbcType=JdbcType.INTEGER),
        @Result(column="CreateTime", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="UpdateTime", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="ChargeStatus", property="chargeStatus", jdbcType=JdbcType.INTEGER)
    })
    List<Mchapp> selectMchappByExample(MchappExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mchapp
     *
     * @mbggenerated Fri Dec 13 10:50:40 CST 2019
     */
    @UpdateProvider(type=MchappSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateMchappByPrimaryKeySelective(Mchapp record);
    @Delete("delete from mchapp where mchid=#{mchid}")
    int deleteMchappByMchid(@Param("mchid") Integer mchid);
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mchapp
     *
     * @mbggenerated Fri Dec 13 10:50:40 CST 2019
     */
    @Update({
        "update mchapp",
        "set MchId = #{mchId,jdbcType=INTEGER},",
          "AppStatus = #{appStatus,jdbcType=INTEGER},",
          "IsPublished = #{isPublished,jdbcType=BIT},",
          "PayChannelStatus = #{payChannelStatus,jdbcType=INTEGER},",
          "RefreshToken = #{refreshToken,jdbcType=VARCHAR},",
          "AccessToken = #{accessToken,jdbcType=VARCHAR},",
          "AppName = #{appName,jdbcType=VARCHAR},",
          "AppNameStatus = #{appNameStatus,jdbcType=INTEGER},",
          "PrincipalName = #{principalName,jdbcType=VARCHAR},",
          "PrincipalType = #{principalType,jdbcType=INTEGER},",
          "RealNameStatus = #{realNameStatus,jdbcType=INTEGER},",
          "HeadImgUrl = #{headImgUrl,jdbcType=VARCHAR},",
          "Categories = #{categories,jdbcType=VARCHAR},",
          "Remark = #{remark,jdbcType=VARCHAR},",
          "AuditRecordId = #{auditRecordId,jdbcType=INTEGER},",
          "CreateTime = #{createTime,jdbcType=TIMESTAMP},",
          "UpdateTime = #{updateTime,jdbcType=TIMESTAMP}",
        "where AppId = #{appId,jdbcType=VARCHAR}"
    })
    int updateByPrimaryKey(Mchapp record);
}